package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TGeofenceMapper;
import com.ruoyi.system.domain.TGeofence;
import com.ruoyi.system.service.ITGeofenceService;

/**
 * 地理围栏Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-09
 */
@Service
public class TGeofenceServiceImpl implements ITGeofenceService 
{
    @Autowired
    private TGeofenceMapper tGeofenceMapper;

    /**
     * 查询地理围栏
     * 
     * @param id 地理围栏主键
     * @return 地理围栏
     */
    @Override
    public TGeofence selectTGeofenceById(Long id)
    {
        return tGeofenceMapper.selectTGeofenceById(id);
    }

    /**
     * 查询地理围栏列表
     * 
     * @param tGeofence 地理围栏
     * @return 地理围栏
     */
    @Override
    public List<TGeofence> selectTGeofenceList(TGeofence tGeofence)
    {
        return tGeofenceMapper.selectTGeofenceList(tGeofence);
    }

    /**
     * 新增地理围栏
     * 
     * @param tGeofence 地理围栏
     * @return 结果
     */
    @Override
    public int insertTGeofence(TGeofence tGeofence)
    {
        tGeofence.setCreateTime(DateUtils.getNowDate());
        return tGeofenceMapper.insertTGeofence(tGeofence);
    }

    /**
     * 修改地理围栏
     * 
     * @param tGeofence 地理围栏
     * @return 结果
     */
    @Override
    public int updateTGeofence(TGeofence tGeofence)
    {
        tGeofence.setUpdateTime(DateUtils.getNowDate());
        return tGeofenceMapper.updateTGeofence(tGeofence);
    }

    /**
     * 批量删除地理围栏
     * 
     * @param ids 需要删除的地理围栏主键
     * @return 结果
     */
    @Override
    public int deleteTGeofenceByIds(Long[] ids)
    {
        return tGeofenceMapper.deleteTGeofenceByIds(ids);
    }

    /**
     * 删除地理围栏信息
     * 
     * @param id 地理围栏主键
     * @return 结果
     */
    @Override
    public int deleteTGeofenceById(Long id)
    {
        return tGeofenceMapper.deleteTGeofenceById(id);
    }
}
